package pe.edu.unmsm.fisi.sisconteg.business.service.impl;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import pe.edu.unmsm.fisi.sisconteg.business.service.OtroEstudioService;
import pe.edu.unmsm.fisi.sisconteg.domain.model.Egresado;
import pe.edu.unmsm.fisi.sisconteg.domain.model.OtroEstudio;
import pe.edu.unmsm.fisi.sisconteg.repository.dao.OtroEstudioDAO;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class OtroEstudioServiceImpl implements OtroEstudioService {

	@Resource
	private OtroEstudioDAO otroEstudioDAO;
	
	@Override
	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void crearOtroEstudio(OtroEstudio otroEstudio, Egresado egresado)
			throws DataAccessException {
		otroEstudio.setEgresado(egresado);
		otroEstudioDAO.crear(otroEstudio);
	}

}
